package ar.com.quickMart.webservices;

import java.util.Date;
import java.util.List;

import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;

import ar.com.quickMart.logic.Branch;
import ar.com.quickMart.logic.ChatMessage;
import ar.com.quickMart.logic.ConfirmedQuickMartList;
import ar.com.quickMart.logic.Employee;

/**
 * 
 * Interfaz que contiene la declaracion de los webservices a
 * desarrollar para la aplicacion web de los supermercados
 * Es una puesta en comun acerca de los nombres a utilizar
 * 
 * @author RP Software
 *
 */

@WebService
public interface WebServiceMethodsWebApp {
		
	@WebMethod
	public abstract boolean checkEmployeeLogin(@WebParam(name="user") String user, @WebParam(name="password") String password);
	
	@WebMethod
	public abstract boolean addBranch(@WebParam(name="supermarket") String supermarket, @WebParam(name="address") String address, @WebParam(name="country") String country, @WebParam(name="province") String province);
	
	@WebMethod
	public abstract boolean addEmployee(@WebParam(name="name") String name, @WebParam(name="surname") String surname, @WebParam(name="phone") String phone, @WebParam(name="username") String username, @WebParam(name="password") String password, @WebParam(name="employeeType") String employeeType, @WebParam(name="supermarket") String supermarket, @WebParam(name="branch") String branch);

	@WebMethod
	public Employee getEmployeeInfo(long id);
	
	@WebMethod
	public Employee getEmployeeInfoByUserName(@WebParam(name="userName") String userName);

	@WebMethod
	public List<Employee> getEmployees(@WebParam(name="branchAddress") String branchAddress,
			@WebParam(name="superMarketName") String superMarketName);

	@WebMethod
	public String getEmployeeType(@WebParam(name="userName") String userName);

	@WebMethod
	public List<String> getCountries();

	@WebMethod
	public List<String> getProvinces(@WebParam(name="countryName") String countryName);

	@WebMethod
	public List<Branch> getBranches(@WebParam(name="supermarketName") String superMarketName);
	
	@WebMethod
	public boolean changeEmployeePassword(@WebParam(name="employeeId") long employeeId, @WebParam(name="password") String password, @WebParam(name="newPassword") String newPassword);
	
	@WebMethod
	public boolean confirmEmployeeLogin(@WebParam(name="userName") String userName, @WebParam(name="date") Date date);
	
	@WebMethod
	public boolean newEmployeeMessage(@WebParam(name="userName") String userName, @WebParam(name="text") String text);

	@WebMethod
	public List<ChatMessage> getEmployeeMessages(@WebParam(name="userName") String userName);
	
	@WebMethod
	public ConfirmedQuickMartList getConfirmedListInfo(@WebParam(name="listId") long listId);
	
	@WebMethod
	public List<ConfirmedQuickMartList> getConfirmedLists(@WebParam(name="branchAddress") String branchAddress,
			@WebParam(name="superMarketName") String superMarketName);
	
	@WebMethod
	public List<ConfirmedQuickMartList> getBeingAssembledLists(@WebParam(name="branchAddress") String branchAddress,
			@WebParam(name="superMarketName") String superMarketName);
	
	@WebMethod
	public List<ConfirmedQuickMartList> getAssembledLists(@WebParam(name="branchAddress") String branchAddress,
			@WebParam(name="superMarketName") String superMarketName);
	
	@WebMethod
	public List<ConfirmedQuickMartList> getNotFinishedLists(@WebParam(name="branchAddress") String branchAddress,
			@WebParam(name="superMarketName") String superMarketName);
	
	@WebMethod
	public List<ConfirmedQuickMartList> getFinishedLists(@WebParam(name="branchAddress") String branchAddress,
			@WebParam(name="superMarketName") String superMarketName);
	
	@WebMethod
	public boolean updateListToBeingAssembled(@WebParam(name="listId") long listId);
	
	@WebMethod
	public boolean updateListToAssembled(@WebParam(name="listId") long listId);
	
	@WebMethod
	public boolean updateListToFinished(@WebParam(name="listId") long listId);
	
	@WebMethod
	public boolean removeEmployee(@WebParam(name="employeeId") long employeeId);
	
	@WebMethod
	public int getPurchaseCountToday(@WebParam(name="branchAddress") String branchAddress,
			@WebParam(name="superMarketName") String superMarketName);
	
	@WebMethod
	public int getPurchaseCountThisMonth(@WebParam(name="branchAddress") String branchAddress,
			@WebParam(name="superMarketName") String superMarketName);
	
	@WebMethod
	public float getTotalMoneyToday(@WebParam(name="branchAddress") String branchAddress,
			@WebParam(name="superMarketName") String superMarketName);
	
	@WebMethod
	public float getTotalMoneyThisMonth(@WebParam(name="branchAddress") String branchAddress,
			@WebParam(name="superMarketName") String superMarketName);

}
